/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.bits.base;

/**
 * <b>(BitParserBase)</b>
 * 二级制解析基类
 * 抽象了解析OBJ对象时的基础功能
 *
 * @author Lihai
 * @version 1.0.0
 * @since 2023/2/8
 */

public class BitParserBase {

    public Integer parseInt(String bit) {
        return Integer.parseInt(bit, 16);
    }

    public static String[] hexStrToArray(String hexStr) {
        String[] array = new String[hexStr.length() / 2];
        int      k     = 2;
        for (int i = 0; i < array.length; i++) {
            array[i] = hexStr.substring(i * 2, k);
            k += 2;
        }
        return array;
    }

}
